package vaani.internal.actionmanagers;

import java.net.URL;
import java.util.LinkedList;
import java.util.List;
import vaani.internal.ProcessInstance;
import vaani.internal.beagle.Result;
//import vaani.shabd.ActivityMiner;
//import vaani.shabd.ApplicationMiner;
import vaani.internal.beagle.Locator;

/**
 *
 * @author sourcemorph
 */

/*this class has more functionality than its parent to suit the needs
 * of File and Media Managers*/

public abstract class GenericManagerBashTypeLevelTwo extends GenericManagerBashType {

    public GenericManagerBashTypeLevelTwo(List<String> arguments) {
        /*high level search to find the url of files related to the arguments*/
        List<URL> searchResults = Locator.find(arguments);
        if(searchResults != null && searchResults.size() != 0) {
            instances = new LinkedList<ProcessInstance>();
            for(URL url : searchResults) {
                /*String defApp = ApplicationMiner.MatchApplication(r.getFileType());
                if(ActivityMiner.getActivityApplication(1).contains(defApp)) {
                    instances.add(createProcessInstance(r));
                }*/
                instances.add(createProcessInstance(url));
            }
        }
    }

    protected abstract ProcessInstance createProcessInstance(URL url);

}
